feat(ptodsl): expose store atomic configuration - #1039
Draft
mouliangyu wants to merge 3 commits into
Draft
Conversation
Add the minimal PTODSL and VPTO lowering needed for TileLang UB-to-GM atomic add, max, and min copies. Co-authored-by: Cursor <cursoragent@cursor.com>
Expose CCE-style atomic configuration operations and preserve ordered CTRL reads so dtype and operation state reaches asynchronous MTE stores. Co-authored-by: Cursor <cursoragent@cursor.com>
mouliangyu
force-pushed
the
codex/store-atomic-structured
branch
from
July 29, 2026 10:02
475fb5f to
59c7804
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
TileLang #115 为了与 AscendC 风格保持一致,会将 UB→GM atomic copy 降为:
本 PR 将个人仓 #569 的两个提交迁移到主仓,为这组 PTODSL/VPTO 配置接口补齐 lowering。
改动
set_atomic_add/max/min/none与set_atomic_f32/f16/bf16/s32/s16/s8PTODSL 接口。CTRL[10:6]的有序读改写,使 dtype/op 状态作用于后续 MTE/FIXP store。get_ctrl改为有序读取,避免 CSE 跨越set_ctrl复用旧值。set_store_atomic_cfg(config),并 lowering 到llvm.hivm.SET.ST.ATOMIC.CFG;该接口属于 SU scalar atomic 路径,不用于 UB→GM MTE atomic。ci-sim自动发现并执行的 UB→GMs32atomic add runtime case。验证
cmake --build build -j 16store_atomic_ctrl_expand.pto(1/1 passed)ctest --test-dir build -R '^ptodsl_jit_compile$' --output-on-failure(1/1 passed)CASE_NAME='micro-op/vector-load-store/mte-ub-gm-atomic-add-s32' test/vpto/scripts/run_host_vpto_validation.sh:A5 CA model compare passed;GM 初值 10、UB 输入 3,64 个输出均为 13git diff --checkCA model 对照也确认
SET.ST.ATOMIC.CFG(4)不控制mte_ub_gm,其结果为普通覆盖;UB→GM atomic 使用本 PR 增加的set_atomic_{dtype/op}CTRL 路径。